/*
 * Copyright (c) 2018 maoyan.com
 * All rights reserved.
 *
 */
package com.darren.euc.dao.impl;

import com.darren.euc.dao.NoticeDao;
import com.darren.euc.entity.Notice;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 在这里编写类的功能描述
 *
 * @author fangwenhao
 * @created 2018/3/11
 */
@Repository
public class NoticeDaoImpl extends BaseDaoImpl<Notice, Long> implements NoticeDao {

    @SuppressWarnings("unchecked")
    @Override
    public List<Notice> findByStatusIn(List<Integer> statusList) {
        Session session = sessionFactory.getCurrentSession();
        Query query  = session.createQuery("from Notice where status in (:statusList)");
        query.setParameterList("statusList", statusList);
        return query.list();
    }

}
